export const formatDateTime = (timestamp, format = 'YYYY-MM-DD HH:mm:ss') => {
    if (!timestamp) return 'N/A'
    const date = new Date(timestamp)

    const pad = (n) => n.toString().padStart(2, '0')

    return format
        .replace('YYYY', date.getFullYear())
        .replace('MM', pad(date.getMonth() + 1))
        .replace('DD', pad(date.getDate()))
        .replace('HH', pad(date.getHours()))
        .replace('mm', pad(date.getMinutes()))
        .replace('ss', pad(date.getSeconds()))
}